<div class="eject_con">
    <div id="warning" class="alert alert-error"></div>
    <form id="message" target="_parent" method="post" action="{:url('Sellerconsult/reply_save',['consult_id'=>$consult.consult_id])}">
        <input type="hidden" name="type" value="{$consult.consult_reply == '' ?'reply':'edit'}"/>
        <dl>
            <dt>{$Think.lang.store_consult_list_consult_content}{$Think.lang.ds_colon}</dt>
            <dd><p style="line-height: 18px;">{:nl2br($consult.consult_content)}</p></dd>
        </dl>
        <dl>
            <dt><i class="required">*</i>{$Think.lang.store_consult_list_reply_consult}{$Think.lang.ds_colon}</dt>
            <dd>
                <input type="hidden" id="consult_id" name="consult_id" value="{$consult.consult_id}"/>
                <textarea  name="content" rows="3" class="w300" maxlength="150">{:nl2br($consult.consult_reply)}</textarea>
            </dd>
        </dl>
        <div class="bottom">
            <input type="submit" class="submit" value="{$Think.lang.ds_ok}" />
        </div>
    </form>
</div>
<script>
    $(function(){
        $('#message').validate({
            errorLabelContainer: $('#warning'),
            submitHandler:function(form){
                ds_ajaxpost('message');
            },
            invalidHandler: function(form, validator) {
                var errors = validator.numberOfInvalids();
                if(errors)
                {
                    $('#warning').show();
                }
                else
                {
                    $('#warning').hide();
                }
            },
            rules : {
                content : {
                    required : true,
                    maxlength: 200
                }
            },
            messages : {
                content : {
                    required : '<i class="iconfont">&#xe64c;</i>{$Think.lang.store_consult_reply_input_content}',
                    maxlength: '<i class="iconfont">&#xe64c;</i>{$Think.lang.store_consult_reply_input_content_tip}'
                }
            }
        });
    });
</script>